inspector: Handle case where there's no default application
authorBenjamin Otte <otte@redhat.com>
Wed, 19 Sep 2018 02:28:09 +0000 (04:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 19 Sep 2018 02:31:29 +0000 (04:31 +0200)
gtk/inspector/object-tree.c

index ff2d0d060e42c09988251236e33bec4b9b9f6520..8df104f86ba366897fa602d7ad1b1619734b8716 100644 (file)
@@ -1113,11 +1113,14 @@ create_root_model (void)
   GtkFilterListModel *filter;
   GtkFlattenListModel *flatten;
   GListStore *list, *special;
+  gpointer item;
 
   list = g_list_store_new (G_TYPE_LIST_MODEL);
 
   special = g_list_store_new (G_TYPE_OBJECT);
-  g_list_store_append (special, g_application_get_default ());
+  item = g_application_get_default ();
+  if (item)
+    g_list_store_append (special, item);
   g_list_store_append (special, gtk_settings_get_default ());
   g_list_store_append (list, special);
   g_object_unref (special);